import u from "../utils";
import { PATH } from "../constants";

const _api = u.api(PATH);
export default {
    versionNode: id => _api('getVersionNodeInfo', { data: { id } }),
}

export const getPath = id => _api('path', { data: { id }, type: 'get' });
export const getPathByAppId = params => _api('appPath', { data: params, type: 'get' });
export const pathNode = id => _api('node', { data: { id }, type: 'get' });
export const saveNode = (params) => _api('node', { data: params, type: 'post' });

export const operatorList = id => _api('operator', { data: { id }, type: 'get' });
export const addOperator = params => _api('operator', { data: params, type: 'post' });
export const deleteOperator = params => _api('deleteOperator', { data: params, type: 'delete' });

export const splitKey = params => _api('splitKey', { data: params });
export const addChildNode = (params) => _api('addNode', { data: params, type: 'post' });